﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using FairyGUI;
using FairyGUI.Utils;
using Project.UI;
using Project.controller;
using Project;
using XLua;

[LuaCallCSharp]
public class UIInitPageView : ViewController {

    public static string Package = "Project";
    public static string ResName = "UIInitPage";

    private GButton testBut;

    public override void ViewDidLoad(FairyGUI.Utils.XML xml)
    {
        base.ViewDidLoad(xml);
        Init();
    }

    void Init()
    {
        testBut = GetChild("testBut").asButton;
        testBut.onClick.Add(OntextButClick);
    }

    [Hotfix]
    void OntextButClick()
    {
        Debug.Log("TurnToMain1");
        EventManager.instance.dispatchEvent(new Events(Events.ON_TURN_TO_MAIN_EVENT));
       // NavigationController.Instance.PushViewController(UIManager.Instance.AddMainPage());
    }
}
